<!doctype html>
<head>
  <title>Example</title>
  <link rel="icon" href="data:;base64,=">
</head>
<h1>Testing Server-Sent Events</h1>

<div id="output"></div>

<script>
  var output = document.getElementById("output");

  var src = new EventSource("/eschan");

  src.onmessage = function(msg) {
    var p = document.createElement("p");
    p.appendChild(document.createTextNode(msg.data));
    output.appendChild(p);
  }
</script>
